﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Collections;


namespace Phong_CTSV
{
    public class Output_Table
    {
        public Output_Table() 
        { 
    
        }

        public static List<ArrayList> Ouput(string formName, string uniName,int year)
        {
            QuerrySQL _querry = new QuerrySQL();
            List<ArrayList> _arraylist = new List<ArrayList>();
            List<Columns_Header> _col_header = _querry.Select_ColumnsHeaderByForm(formName);
            List<Rows_Header> _row_header = _querry.Select_RowsHeaderByForm(formName);
            ArrayList _lable_row = new ArrayList();
            _lable_row.Add("");
            foreach (Rows_Header row_header in _row_header)
                _lable_row.Add(row_header.Name);
            _arraylist.Add(_lable_row);
            foreach (Columns_Header col_header in _col_header)
            { 
                int uni_ID = (int)_querry.Select_University(uniName).ID;
                List<Data_Table> data = _querry.Select_Data_Columns((int)col_header.Form_id, uni_ID, (int)col_header.ID, year);
                ArrayList _temp = new ArrayList(data);
                _temp.Insert(0, col_header.Name);
                _arraylist.Add(_temp);
            }
            return _arraylist;

        }

    }
}